<!--
<script src="/tpl/pg/js/jquery-1.11.0.min.js"></script>
-->
<script src="/tpl/pg/js/jquery-1.10.2.js"></script>
<script src="/tpl/pg/bootstrap/js/bootstrap.min.js"></script>
<script src="/tpl/pg/js/jasny-bootstrap.min.js"></script>
<script src="/tpl/pg/js/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="/tpl/pg/js/plugins/timepicker_addon/jquery-ui-timepicker-addon.js"></script>

<script src="/tpl/pg/js/plugins/jQuery-Validation-Engine/js/languages/jquery.validationEngine-en.js"></script>
<script src="/tpl/pg/js/plugins/jQuery-Validation-Engine/js/jquery.validationEngine.js"></script>

<script src="/tpl/pg/js/plugins/jquery-ui/ui/jquery.ui.datepicker.js"></script>
<script src="/tpl/pg/js/plugins/jquery-ui/ui/i18n/jquery.ui.datepicker-it.js"></script>

<script src="/tpl/pg/js/plugins/jtable/lib/jquery.jtable.min.js" ></script>
<!--
<script src="/tpl/pg/js/plugins/jtable/jquery.jtable.min.js" ></script>
-->
<!--
<script src="/tpl/pg/js/plugins/jtable/lib/bootstrap3-depend/jquery-ui-1.10.3.widget.min.js" ></script>
-->
<!--
<script src="/tpl/pg/js/plugins/jtable/lib/localization/jquery.jtable.it.js" ></script>
-->

<script src="/tpl/pg/js/plugins/select2-3.4.6/select2.min.js"></script>

<script src="/tpl/pg/js/plugins/chosen/chosen.jquery.min.js"></script>

<script src="/tpl/pg/js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Page-Level Plugin Scripts - Dashboard -->
<script src="/tpl/pg/js/jquery.ui.touch-punch.min.js" ></script>
<script src="/tpl/pg/js/plugins/morris/raphael-2.1.0.min.js"></script>
<script src="/tpl/pg/js/plugins/morris/morris.js"></script>

    <!-- Page-Level Demo Scripts - Dashboard - Use for reference -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<!--
<script type="text/javascript" src="/tpl/pg/js/plugins/jquery-ui-map-3.0-rc/ui/jquery.ui.map.js"></script>
-->
<script type="text/javascript" src="/tpl/pg/js/gmap3.min.js"></script>
<!--
<script src='/tpl/include/moment-with-langs.min.js'></script>
-->
<script src='/tpl/pg/js/plugins/prettyPhoto3.1.5/js/jquery.prettyPhoto.js'></script>
<!--
<script src='/tpl/include/fullcalendar-2.0.0-beta/fullcalendar/fullcalendar.min.js'></script>
-->
<!--
<script src='/tpl/include/fullcalendar-2.0.0-beta/fullcalendar/lang/it.js'></script>
-->
<!-- SB Admin Scripts - Include with every page -->

<script src="/tpl/pg/js/sb-admin.js"></script>
<script src="/tpl/ic/js/scripts.js"></script>
<script type="text/javascript">
$(document).ready(function(){

     //$( document ).tooltip({
//track: true
//});
$(".Preview").hide()
$(".Edit_dao").hide()

{{'$( ".onlywithschema" ).hide()' if not schemaa}}>

$(".ricercaBox").hide()
$("#iconaricerca").click(function(e){
    $('.ricercaBox').toggle(400,function() {
     if ($('.ricercaBox').is(':visible')) {
        $('#edit_dao').prop('disabled', true);
        $('#new_dao').prop('disabled', true);
        $('#anteprima').prop('disabled', true);
        $('#print_dao').prop('disabled', true);
        $('#import_csv').prop('disabled', true);
        $('#export').prop('disabled', true);
    } else {
        $('#edit_dao').prop('disabled', false);
        $('#new_dao').prop('disabled', false);
        $('#anteprima').prop('disabled', false);
        $('#print_dao').prop('disabled', false);
        $('#import_csv').prop('disabled', false);
        $('#export').prop('disabled', false);
    }});

          e.preventDefault();
    $(".Edit_dao").hide()
    $(".Preview").hide()
    $("#tableContainer_ac").show()
    });

$( "#selectbasic" ).chosen({allow_single_deselect: true})
$( "#selectbasic" ).change(function (e){
    var schema = $("#selectbasic").find("option:selected").attr("id");
    $.post( "/pg/cs", { schema: schema } );
    if (schema != ""){
        $( ".onlywithschema" ).show()
        //location.reload();
    } else {
        $( ".onlywithschema" ).hide()
        //window.location.href="/pg/main";
    };

    })

{% if pageData["role"]|lower !="admin" %}
    $(".onlyadmin").hide()
    $(".onlywithschema").show()
{% elif pageData["role"]|lower =="admin" %}
    $(".onlyadmin").show()
    $(".onlywithschema").show()

{% endif %}

{% if pageData["oper"].tipo_operatore|lower == "amministratore" %}
$(".nomenu").hide()
$(".onlyadmin").hide()

$(".onlywithschema").hide()
$(".onlyoperadm").show()
{% endif %}

});
</script>
